In the rendering of three-dimensional graphics for computer systems, the curved surfaces of objects are generally represented as a wire-frame of planar polygons. In high-speed graphics, the polygons are often simple triangles where each triangle has three vertices and each vertex has attributes of position, normal, and color. The vertex position is defined, for example, in the object coordinate space. The vertex normals are unit vectors which describe the surface orientation at each vertex. The vertex color provides the color of the object.
In order to generate a realistic image of an object, such as a billiard ball, not only must the triangles form the roughly spherical shape, but they must also include the shading of the surfaces. This requires taking into account the illumination and a combination of three reflection functions which are ambient, diffuse, and specular reflections.
Ambient reflection provides the billiard ball's color due to indirect reflection of light from the surrounding environment. Diffuse reflections are reflections from surfaces in which light is scattered equally in all directions. Specular reflection is the highlight due to shiny surfaces such as the reflection of a light on the billiard ball.
To provide realistic highlights, a number of different illumination techniques have been developed and one of the most preferred is Phong shading. Bui-Tuong Phong developed the shading/illumination technique which bears his name. Phong, BT, "Illumination for Computer Generated Images", Ph.D. Dissertation, Department of Computer Science, University of Utah, Salt Lake City, Gov. ordering No. AD-A0008-786 (July 1973)). The Phong illumination model modulates specular reflection as a function of the cosine of the angle between the vector to the viewing point and the vector which aligns with the maximum reflection.
Where there are a number of light sources which affect the specular reflection, the amount of reflection is additive. Effectively, this means if a number of different light sources shine off a surface, the reflection is the sum of the reflection due to each light source.
Currently, there are two approaches to using Phong illumination calculations. The first is a vertices-based technique in which a Phong illumination computation is done for each light at each vertex of the triangles which make up the object. This technique was an attempt to develop real-time realism for relatively inexpensive computer game computers. The reflections are summed and then blended across the surface of the object. This can be done relatively quickly and does not require a lot of hardware for the generation of the image. Unfortunately, the results, especially in cases with specular highlights, are relatively poor. One visual difficulty observed is that in cases where specular highlights should not move, such as highlight on a rotating billiard ball, highlights tend to move, following the edges of the polygons.
The other approach involves a pixel/subpixel technique. The Phong illumination computation is done for each light at each pixel/subpixel element of the object. This eliminates the problems with specular highlights and produces much more realistic highlights than the vertices-based technique. However, as there are a large number of pixels per triangle, this technique is very costly since Phong illumination computations (an expensive computation process) are done at each pixel/subpixel for the object.
The cost of using Phong illumination computations is evident when it is understood that the hardware must solve an equation which requires the solution of 7 additions, 6 multiplications, 1 division, and 1 square root calculation per pixel per light per color component. The calculation is very expensive and time-consuming, especially because it includes the square root calculation. Each Phong calculation, at three colors per pixel according to the OpenGL (Graphic Language) standard which requires at least 8 lights, requires 115 additions, 72 subtractions, 171 multiplications, 8 divisions, 16 exponentials, 8 absolute values, 24 maximum values, 24 dot products, and 24 unit vector the Phong calculation could have to be performed some 780,000 times. Furthermore, if objects should overlap, multiple Phong computations may be necessary. Further, for realism in animation, the human eye notices refreshment of the screen if it is slower than 30 frames per second, so all of these computations must be performed faster than 30 times a second.
Phong illumination is an extremely realistic modeling of lighting conditions for graphic images, but it is incredibly expensive in terms of computational hardware and computation time.
The long sought goal has been to achieve the quality of Phong illumination at a speed suitable for animation and video games at a reasonable consumer price.
A further goal has been to reduce the per pixel cost while increasing visual qualities over the vertices-only approach. Various approaches have been attempted.
While Phong illumination has been long known, it has not come into popular use for real-time, high-definition systems at a reasonable consumer price because of the computation time required for each pixel. Thus, although there have been a number of attempts to eliminate the problems with specular highlights and produce graphics with Phong illumination computations being used which are better than the vertices-based technique, a solution has long eluded those skilled in the art.